/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package devbureau.fstore.common;

/**
 *
 * @author buyakov
 */
public enum OrderStatus {
    prepare(0,"формируется")
    ,confirm(1,"сформирован")
    ,paid(2,"оплачен");

    private Integer num = null;
    private String title;
    OrderStatus(Integer i, String t){
        num = i;
        title = t;
    }

    public Integer getNum(){
        return num;
    }

    public String getTitle(){
        return title;
    }

    public static OrderStatus determineStatus(final Integer i){
        OrderStatus os = null;
        switch(i){
            case 0: os = prepare; break;
            case 1: os = confirm; break;
            case 2: os = paid;
        }
        return os;
    }
}


